---
title: "Row Grouping - Hierarchy Selection"
enterprise: true
---
Row Selection can be configured with groups to select all of a rows descendants.

## Selecting Descendants

When using [Multiple Row Selection](./row-selection-multi-row/) with row grouping, the grid can be configured to impact descendant and
ancestor rows when a row is selected.

To enable hierarchical selection, set the `selection.groupSelects` option to one of the following values:

- `'self'`: Selecting a group row has no additional side effects.
- `'descendants'`: Selecting a group row will select all of its descendants.
- `'filteredDescendants'`: Selecting a group row will select all of its descendants that pass the filter.

{% gridExampleRunner title="Group Selection" name="group-selection" /%}

The example above demonstrates the following configuration:
```{% frameworkTransform=true %}
const gridOptions = {
    rowSelection: {
        mode: 'multiple',
        groupSelects: 'descendants',
    },
}
```

{% note %}
When using `groupSelects: 'descendants'` or `groupSelects: 'filteredDescendants'`, group nodes will not be returned as part of `api.getSelectedNodes()` or `api.getSelectedRows()`.
{% /note %}

## Checkboxes in Group Cells

When using [Row Selection](./row-selection/) with grouping, the grid can be configured to render checkboxes in the group cell, to
the right of the expand/collapse chevron.

This can be configured on by setting the `rowSelection.checkboxLocation` option to `'autoGroupColumn'`.

{% gridExampleRunner title="Group Cell Checkboxes" name="group-cell-checkboxes" /%}

The example above demonstrates the following configuration to render checkboxes in the group cell:

```{% frameworkTransform=true %}
const gridOptions = {
    rowSelection: {
        mode: 'multiRow',
        checkboxLocation: 'autoGroupColumn',
    },
}
```

## Next Up
Continue to the next section to learn [Sorting Groups](./grouping-sorting/).
